package cn.edu.hznu.ocw.actions;

import java.util.List;

import cn.edu.hznu.ocw.dao.CourseTypeDAO;
import cn.edu.hznu.ocw.domain.CourseType;

import com.googlecode.jsonplugin.annotations.JSON;
import com.opensymphony.xwork2.Action;

public class LoadCourseMenuAction extends OCWAction {
	private static final long serialVersionUID = -4356998124684185381L;
	
	private List<CourseType> list = null;

	@Override
	public String execute() throws Exception {
		CourseTypeDAO ctd = new CourseTypeDAO();
		list = ctd.getCourseTypes();
		return Action.SUCCESS;
	}
	
	@JSON(name="TypeList")
	public List<CourseType> getList(){
		return list;
	}
}
